package com.xiaoyi.controller.userController;

import com.xiaoyi.service.BusinessInfoService;
import com.xiaoyi.service.impl.BusinessInfoServiceImpl;
import com.xiaoyi.utils.WebUrlUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Writer;

@WebServlet(urlPatterns = "/userHome.do")
public class UserHomeController extends HttpServlet {
    private BusinessInfoService bis=new BusinessInfoServiceImpl();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String url=bis.goUserHome(req);
        resp.sendRedirect(WebUrlUtil.getUrl(req)+url);
    }
}
